package com.bwie.mq;

import com.bwie.common.pojo.po.UserPo;
import com.bwie.common.result.Result;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.utils.SerializationUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AuthMq {
    @RabbitListener(queuesToDeclare = @Queue("authMq"))
    private void mqAuth(Message message){
        byte[] body = message.getBody();
        UserPo deserialize = (UserPo) SerializationUtils.deserialize(body);
        System.out.println("=======================这个是mq"+deserialize);
//        System.out.println("=======================这个是mq"+username);
    }
}
